import java.util.*;

/**
 * @Author 12629
 * @Description：
 */
public class Test {
    public static void main(String[] args) {
        TestBinaryTree testBinaryTree = new TestBinaryTree();
        TestBinaryTree.TreeNode root = testBinaryTree.createTree();
//        TestBinaryTree.TreeNode ret =
//                testBinaryTree.invertTree(root);
        System.out.println("====");
//        testBinaryTree.preOrder(ret);
        System.out.println("层序遍历：");
        testBinaryTree.levelOrder(root);
        System.out.println();
    }
    public static void main3(String[] args) {
        TestBinaryTree testBinaryTree = new TestBinaryTree();
        TestBinaryTree.TreeNode root = testBinaryTree.createTree();
        System.out.println("====");
        testBinaryTree.preOrder(root);
        System.out.println();
        testBinaryTree.inOrder(root);
        System.out.println();
        testBinaryTree.postOrder(root);
        System.out.println();
        System.out.println("====");

        System.out.println("节点个数： "+testBinaryTree.size(root));
        testBinaryTree.size2(root);
        //System.out.println("节点个数2： "+TestBinaryTree.nodeSize);
        System.out.println("节点个数2： "+testBinaryTree.nodeSize);
        System.out.println("叶子节点的个数："+
                testBinaryTree.getLeafNodeCount(root));

        testBinaryTree.getLeafNodeCount2(root);
        System.out.println("叶子节点的个数2："+
                testBinaryTree.leafSize);


        System.out.println("第K层的节点个数： "
                +testBinaryTree.getKLevelNodeCount(root,3));


        TestBinaryTree.TreeNode ret =
                testBinaryTree.find(root,'E');
        System.out.println("查找： "+ret.val);



        System.out.println("**********************");
        TestBinaryTree testBinaryTree2 = new TestBinaryTree();
        TestBinaryTree.TreeNode root2 = testBinaryTree2.createTree();
        System.out.println("节点个数： "+testBinaryTree2.size(root2));
        testBinaryTree2.size2(root2);
        //System.out.println("节点个数2： "+TestBinaryTree.nodeSize);
        System.out.println("节点个数2： "+testBinaryTree2.nodeSize);
    }
    public static void main1(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        Deque<Integer> queue2 = new LinkedList<>();

        Deque<Integer> stack2 = new ArrayDeque<>();
        stack2.push(1);
        Deque<Integer> stack3 = new LinkedList<>();
        stack3.push(1);


        ArrayList<Integer> arrayList = new ArrayList<>();
        LinkedList<Integer> linkedList = new LinkedList<>();

    }
}